﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using FSS.BLL.Entities;
namespace FSS.BLL.Services
{
	#region VoucherOutDetailService

	/// <summary>
	/// VoucherOutDetailService object for Ibatis mapped table 'VoucherOutDetail'.
	/// </summary>
	public class VoucherOutDetailService : IVoucherOutDetailService
	{
		private static readonly ILog log = LogManager.GetLogger(typeof(VoucherOutDetailService).Name);
	  	private static volatile VoucherOutDetailService _VoucherOutDetailService = null;
        public static VoucherOutDetailService GetInstance()
        {
            if (_VoucherOutDetailService == null)
            {
                lock (typeof(VoucherOutDetailService))
                {
                    if (_VoucherOutDetailService == null) // double-check
                        _VoucherOutDetailService = new VoucherOutDetailService();
                }
            }
            return _VoucherOutDetailService;
        }
		public VoucherOutDetailService()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        /// <summary>
        /// Lấy danh sách chi tiết theo mã cha
        /// </summary>
        /// <returns></returns>
        public IList<VoucherOutDetailEntity> GetAllDetailByMasterID(Int64 VoucherOutId)
        {
            try
            {
                VoucherOutDetailEntity obj = new VoucherOutDetailEntity
                {
                    VoucherOutId = VoucherOutId
                };
                return ExecuteQueryForList<VoucherOutDetailEntity>("VoucherInDetailLoadAllByMasterID", obj);
            }
            catch (Exception ex)
            {
                throw ex;
                //log.Debug(ex.Message);
                //return null;
            }
        }
	}
	#endregion  
}
